package org.springframework.validation.executors;

/**
 * Performs validation for a given rule.
 * @author cduplichien
 *
 */
public interface RuleExecutor {
	
	/**
	 * Validate the given rule
	 * Generally, a rule should return valid if the model is null or empty, 
	 * unless this is a rule to validate the presence of the object.
	 * 
	 * @param model The object on which the rule operates
	 * @param argument Some argument providing details on how to operate on the object
	 * @return true if valid
	 * @throws Exception any exception to be handled by the parent framework.
	 */
	public boolean validate(Object model, Object argument) throws Exception;

}
